package chainx

import (
	"github.com/tmc/langchaingo/callbacks"
	"github.com/tmc/langchaingo/memory"
	"github.com/tmc/langchaingo/prompts"
	"github.com/tmc/langchaingo/schema"
)

type routerOptions struct {
	prompt           prompts.PromptTemplate
	memory           schema.Memory
	callbacksHandler callbacks.Handler
	emptyHandle      Handler
}

type RouterOption func(*routerOptions)

func executorDefaultOptions(handlers []Handler) routerOptions {
	return routerOptions{
		prompt: createPrompt(handlers),
		memory: memory.NewSimple(),
	}
}

func WithRouterPrompt(prompt prompts.PromptTemplate) RouterOption {
	return func(options *routerOptions) {
		options.prompt = prompt
	}
}

func WithRouterMemory(memory schema.Memory) RouterOption {
	return func(options *routerOptions) {
		options.memory = memory
	}
}

func WithRouterCallbacksHandler(callbacks callbacks.Handler) RouterOption {
	return func(options *routerOptions) {
		options.callbacksHandler = callbacks
	}
}

func WithRouterEmptyHandle(emptyHandle Handler) RouterOption {
	return func(options *routerOptions) {
		options.emptyHandle = emptyHandle
	}
}
